/*!  \file  setThreads.h
 *	  \brief  
 * 
 *   \details   details
 *   \author    Yordan Madzhunkov German Research School for Simulation Sciences GmbH
 *   \version   1.0
 *   \date      11/29/2013 11:06:27 AM
 *   \copyright GNU Public License.
 */
#pragma once

//#define SET_NUM_THREADS(x)	omp_set_num_threads(x)
#define SET_NUM_THREADS(x) ;

// for open blas


#ifdef USE_OPEN_BLAS
   #define SET_NUM_THREADS(x) openblas_set_num_threads(x);
   #ifdef __cplusplus
   extern "C" {
	   /* Assume C declarations for C++ */
   #endif  /* __cplusplus */

   void openblas_set_num_threads(int num_threads);
   void goto_set_num_threads(int num_threads);

   /*Get the build configure on runtime.*/
   char* openblas_get_config(void);

   /* Get the parallelization type which is used by OpenBLAS */
   int openblas_get_parallel(void); 
   #ifdef __cplusplus
   }
   #endif  /* __cplusplus */
#else
#ifdef USE_MKL_BLAS
   #include "mkl.h"
   #define SET_NUM_THREADS(x)\
	   mkl_set_num_threads(x);\
	   mkl_set_dynamic(0);
   #endif
#endif

